import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/views/index.vue'
import Scene from '@/views/scene.vue'
import Hotel from '@/views/hotel.vue'
import Regs from '@/views/regs.vue'
import Login from '@/views/login.vue'
import Person from '@/views/person.vue'
import ModifyUserInfo from "@/views/modifyUserInfo";

Vue.use(Router)

export default new Router({
  mode: 'hash', // history
  base: process.env.BASE_URL,
  linkActiveClass: 'activty',
  routes: [{
    path: '/',
    redirect: '/index'
  },
    {
      path: '/index',
      name: 'index',
      component: Index
    },
    {
      path: '/scene',
      name: 'scene',
      component: Scene
    },
    {
      path: '/hotel',
      name: 'hotel',
      component: Hotel
    },
    {
      path: '/regs',
      name: 'regs',
      component: Regs
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/person',
      name: 'person',
      component: Person,
      children: [
        {
          path: 'savePost',
          name: 'savePost',
          component: () => import('../views/savePost.vue')
        }, {
          path: 'saveScene',
          name: 'saveScene',
          component: () => import('../views/saveScene.vue')
        }, {
          path: 'saveHotel',
          name: 'saveHotel',
          component: () => import('../views/saveHotel.vue')
        }
      ]
    }, {
      path: '/modifyUserInfo',
      name: 'modifyUserInfo',
      component: ModifyUserInfo
    }
  ]
})
